package com.core.gui.components;

import java.util.List;

import javax.swing.ComboBoxModel;
import javax.swing.JComboBox;

public class PlaceComboBox<T> extends JComboBox<T> {
	private static final long serialVersionUID = 1L;

	PlaceComboBoxModel<T> comboBoxModel = null;

	@SuppressWarnings("unchecked")
	public PlaceComboBox() {
		super();
		comboBoxModel = new PlaceComboBoxModel<T>();
		this.setModel((ComboBoxModel<T>) this.comboBoxModel);
	}

	public PlaceComboBoxModel<T> getComboBoxModel() {
		return comboBoxModel;
	}

	public void setComboBoxModel(PlaceComboBoxModel<T> comboBoxModel) {
		this.comboBoxModel = comboBoxModel;
	}

	public void setPlaces(List<T> places) {
		comboBoxModel.setPlaces(places);
	}

	public void clear() {
		comboBoxModel.clear();
	}
}
